package leetcode.code0458;

public class Solution1 extends Solution458 {

	@Override
	public int poorPigs(int buckets, int minutesToDie, int minutesToTest) {
		int states = minutesToTest / minutesToDie + 1;
		int pigs = 0;
		while (Math.pow(states, pigs) < buckets) {
			pigs++;
		}
		return pigs;
	}
	public int poorPigs1(int buckets, int minutesToDie, int minutesToTest) {
		int states = minutesToTest / minutesToDie + 1;
		int pigs = 1;
		while (Math.pow(states, pigs) < buckets) {
			pigs++;
		}
		return pigs;
	}

	public static void main(String[] args) {
		Solution1 so = new Solution1();
		so.debug1();
		so.debug2();
		so.debug3();
	}

}
